package com.itheima.mvc;

import com.itheima.domian.Account;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class QuickController {
    @RequestMapping("/quick3")
    @ResponseBody
    public Account quickMethod3(){
        Account user = new Account();
        user.setName("lisi2");
        user.setMoney(3200);
        return user;
    }

    @RequestMapping("/quick2")
    @ResponseBody
    public void quickMethod2(){
        System.out.println("RosponseBody 页面不跳转.");

    }
    @RequestMapping("/quick")
    public String quickMethod(){
        System.out.println("quickMethod running.....");
        return "/index.jsp";
    }
    @RequestMapping("/quick1")
    public ModelAndView quickMethod1(ModelAndView modelAndView){
        modelAndView.addObject("username","zhangsan");
        modelAndView.setViewName("/success.jsp");
        return modelAndView;
    }
}
